<?php

/**
 * Created by PhpStorm.
 * User: dev
 * Date: 22/9/2014
 * Time: 2:01 PM
 */
class Users extends Eloquent
{

    public static $table = 'users';
    public static $key = 'id';


    function __construct()
    {
        parent::__construct();

    }



    public static function isAdmin()
    {
        if (Auth::user()->role_id == 1) {
            return true;
        }
    }


    public function role()
    {
        return $this->belongs_to('Roles');
    }

    public function post()
    {
        return $this->has_many('Post');
    }


}